package io.jboot.fly.service.impl;

import io.jboot.aop.annotation.Bean;
import io.jboot.core.cache.annotation.Cacheable;
import io.jboot.fly.model.Category;
import io.jboot.fly.service.AttachmentCategoryService;
import io.jboot.fly.model.AttachmentCategory;
import io.jboot.service.JbootServiceBase;

import javax.inject.Singleton;
import java.util.List;

@Bean
@Singleton
public class AttachmentCategoryServiceImpl extends JbootServiceBase<AttachmentCategory> implements AttachmentCategoryService {
    @Override
    @Cacheable(name = "attachment_category", key = "all")
    public List<AttachmentCategory> findAll() {
        String sql = "select * from `attachment_category` order by order_number asc";
        return DAO.find(sql);
    }

}